package com.innovation.chengzhangriji.ui;

import android.os.Bundle;
import android.view.View;

import com.google.gson.Gson;
import com.innovation.chengzhangriji.Config;
import com.innovation.chengzhangriji.R;
import com.innovation.chengzhangriji.preferences.LoginInfo;
import com.innovation.chengzhangriji.ui.widget.CuteImageView;

public class EditUserInfoDialogActivity extends BaseActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_edit_user_info_dialog);
        CuteImageView image = (CuteImageView) findViewById(R.id.btn_edit);
        image.setOnClickListener(this);
        LoginInfo loginInfo = Config.getLoginInfo(this);
        if (loginInfo == null) {
            return;
        }
        loginInfo.setHasTipEdit(true);
        Gson gson = new Gson();
        Config.setLoginInfo(this, gson.toJson(loginInfo));
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_edit:
                setResult(RESULT_OK);
                finish();
                break;
        }
    }
}
